#include "programlanguagetranslate.h"
#include <QStringList>
//#include "../HmiCommunicate/enum.h"
#include "instructionEnum.h"

ProgramLanguageTranslate::ProgramLanguageTranslate()
{
}

QStringList ProgramLanguageTranslate::translateProgramCmdList(int language, const QStringList &cmdListIn)
{
    //language 用于区分语言:目前不需要,只有中文
    QStringList returnCmdList = cmdListIn;//返回用

    // English -> Chinese
    if(language == ENUM_LAN_CHINESE)
    {
        for(int i = 0; i < cmdListIn.size(); i++)
        {
            //此处可能有问题\\/\\/
            QRegExp rx("\\s*[\\/\\/]{0,2}\\s*([A-Z_]*)\\-?\\s*([BEXND]{0,3})\\s*\\_?\\d*\\s*([PAL]{0,3})\\s*(.*)");
            cmdListIn[i].indexOf(rx);

            QRegExp rxForward("\\s*([A-Z_]*)\\s+(.*)");
            if(i > 0)
            {
                QString instruction = cmdListIn[i - 1];
                instruction.indexOf(rxForward);
            }
            /**************** J-关节 L-直线 C-圆弧 *****************/
            if((("J" == rx.cap(1)) || ("L" == rx.cap(1)) || ("C" == rx.cap(1)) || ("A" == rx.cap(1)) || ("C" == rxForward.cap(1)))
                    && ("PAL" != rx.cap(3)))
            {
    //            returnCmdList[i].replace(QRegExp("^\\s*J"), "关节");
    //            returnCmdList[i].replace(QRegExp("^\\s*L"), "直线");
    //            returnCmdList[i].replace(QRegExp("^\\s*C"), "圆弧");
                returnCmdList[i].replace("J ", "关节 ");
                returnCmdList[i].replace("L ", "直线 ");
                returnCmdList[i].replace("C ", "圆弧 ");
                returnCmdList[i].replace(QRegExp("[P]\\s*[[]"), "位置[");
                returnCmdList[i].replace(QRegExp("PR"), "位置暂存器");
                returnCmdList[i].replace(QRegExp("[R][[]"), "寄存器[");

                returnCmdList[i].replace("FINE", "通过");
                returnCmdList[i].replace("CNT", "接近");

                returnCmdList[i].replace("DI", "监视输入");
                returnCmdList[i].replace("ON", "开");
                returnCmdList[i].replace("OFF", "关");

                returnCmdList[i].replace("Skip", "跳到");
                returnCmdList[i].replace("LBL", "标签");

                returnCmdList[i].replace("Wjnt", "手腕关节动作");
                returnCmdList[i].replace("INC", "增量运动");
                returnCmdList[i].replace("ACC", "加速度");
                returnCmdList[i].replace("EV", "附加轴速度");
                returnCmdList[i].replace("PTH", "路径");
                returnCmdList[i].replace(QRegExp("[^_]Offset"), " 位置补偿");
                returnCmdList[i].replace("Tool_Offset", "工具补偿");
            }
            /**************** PALLETIZING 码垛 *********************/
            else if("PALLETIZING" == rx.cap(1))
            {
                returnCmdList[i].replace("PALLETIZING", "码垛");
                returnCmdList[i].replace("END", "尾");
            }
            /**************** J-关节 L-直线 PAL-码垛 ***************/
            else if((("J" == rx.cap(1)) || ("L" == rx.cap(1))) && ("PAL" == rx.cap(3)))
            {
                returnCmdList[i].replace("J ", "关节 ");
                returnCmdList[i].replace("L ", "直线 ");
                returnCmdList[i].replace("PAL", "码垛");
                returnCmdList[i].replace("A_", "接近点_");
                returnCmdList[i].replace("R_", "逃离点_");
                returnCmdList[i].replace("BTM", "堆栈点");
                returnCmdList[i].replace("FINE", "通过");
                returnCmdList[i].replace("CNT", "接近");
                returnCmdList[i].replace("DI", "数字输入信号");
                returnCmdList[i].replace("ON", "开");
                returnCmdList[i].replace("OFF", "关");
                returnCmdList[i].replace("Skip,LBL", "跳过,标签");
            }
            /**************** IF-如果 ***********************/
            else if("IF" == rx.cap(1))
            {
                returnCmdList[i].replace("IF", "如果条件");
                returnCmdList[i].replace("JMP LBL", "跳转到 标签");
                returnCmdList[i].replace("CALL", "调用程序");

                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("PL[", "栈板寄存器");
                returnCmdList[i].replace("PR[", "位置寄存器");

                returnCmdList[i].replace("AO", "模拟输出信号");
                returnCmdList[i].replace("AI", "模拟输入信号");
                returnCmdList[i].replace("GO", "群组输出信号");
                returnCmdList[i].replace("GI", "群组输入信号");
                returnCmdList[i].replace("DO", "数字输出信号");
                returnCmdList[i].replace("DI", "数字输入信号");
                returnCmdList[i].replace("RO", "机器人输出信号");
                returnCmdList[i].replace("RI", "机器人输入信号");
                returnCmdList[i].replace("SO", "操作面板输出信号");
                returnCmdList[i].replace("SI", "操作面板输入信号");
                returnCmdList[i].replace("UO", "外围设备输出信号");
                returnCmdList[i].replace("UI", "外围设备输入信号");

                returnCmdList[i].replace("ON", "开");
                returnCmdList[i].replace("OFF", "关");

                returnCmdList[i].replace("AND", "且");
                returnCmdList[i].replace("OR", "或");
            }
            /********LBL-标签 JMP-标签跳转 END-结束 PAUSE-暂停 ABORT-终止 CALL-调用 RUN-开始任务 ************/
            else if(("LBL" == rx.cap(1)) || ("JMP" == rx.cap(1)) || ("END" == rx.cap(1)) || ("PAUSE" == rx.cap(1))
                    || ("ABORT" == rx.cap(1)) || ("CALL" == rx.cap(1)) || ("RUN" == rx.cap(1)))
            {
                returnCmdList[i].replace("LBL", "标签");
                returnCmdList[i].replace("JMP", "跳转到");
                returnCmdList[i].replace("END", "结束");
                returnCmdList[i].replace("PAUSE", "暂停");
                returnCmdList[i].replace("ABORT", "终止");
                returnCmdList[i].replace("CALL", "调用程序");
                returnCmdList[i].replace("RUN", "开任务");

                returnCmdList[i].replace("R[", "寄存器[");
            }
            /******************* WAIT-等待命令 **********************/
            else if("WAIT_COMMAND" == rx.cap(1))
            {
                returnCmdList[i].replace("WAIT_COMMAND", "等待命令");

                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("TIMEOUT", "等待超时转移");
                returnCmdList[i].replace("JMP", "跳转到");
                returnCmdList[i].replace("LBL", "标签");
            }

            /******************* WAIT-等待 **********************/
            else if("WAIT" == rx.cap(1))
            {
                returnCmdList[i].replace("WAIT", "等待");

                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("AO", "模拟输出信号");
                returnCmdList[i].replace("AI", "模拟输入信号");
                returnCmdList[i].replace("GO", "群组输出信号");
                returnCmdList[i].replace("GI", "群组输入信号");
                returnCmdList[i].replace("DO", "数字输出信号");
                returnCmdList[i].replace("DI", "数字输入信号");
                returnCmdList[i].replace("RO", "机器人输出信号");
                returnCmdList[i].replace("RI", "机器人输入信号");
                returnCmdList[i].replace("SO", "操作面板输出信号");
                returnCmdList[i].replace("SI", "操作面板输入信号");
                returnCmdList[i].replace("UO", "外围设备输出信号");
                returnCmdList[i].replace("UI", "外围设备输入信号");

                returnCmdList[i].replace(QRegExp("ON[^+]"), "开");
                returnCmdList[i].replace(QRegExp("OFF[^-]"), "关");
                returnCmdList[i].replace("ON+", "信号上升沿");
                returnCmdList[i].replace("OFF-", "信号下降沿");

                returnCmdList[i].replace("AND", "且");
                returnCmdList[i].replace("OR", "或");

                returnCmdList[i].replace("TIMEOUT", "等待超时转移");
                returnCmdList[i].replace("LBL", "标签");
            }
            /******************* FOR-循环 ***********************/
            else if(("FOR" == rx.cap(1)) || ("ENDFOR" == rx.cap(1)))
            {
                returnCmdList[i].replace("FOR ", "循环开始 ");
                returnCmdList[i].replace("END循环开始", "循环结束");
                returnCmdList[i].replace("ENDFOR", "循环结束");

                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("A寄存器", "自变量寄存器");

                returnCmdList[i].replace(" TO", " 增加到");
                returnCmdList[i].replace("DOWNTO", "减小到");
            }
            /******************* R-寄存器 GR-群组寄存器 PR-位置寄存器 PL-栈板寄存器 ************************/
            else if(("R" == rx.cap(1))|| ("GR" == rx.cap(1)) || ("PR" == rx.cap(1)) || ("PL" == rx.cap(1)))
            {

                returnCmdList[i].replace("PR[", "位置寄存器[");
                returnCmdList[i].replace("PL[", "栈板寄存器[");
                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("G寄存器", "群组寄存器");

                returnCmdList[i].replace("A寄存器", "自变量寄存器");
                returnCmdList[i].replace("AO", "模拟输出信号");
                returnCmdList[i].replace("AI", "模拟输入信号");
                returnCmdList[i].replace("GO", "群组输出信号");
                returnCmdList[i].replace("GI", "群组输入信号");
                returnCmdList[i].replace("DO", "数字输出信号");
                returnCmdList[i].replace("DI[", "数字输入信号[");
                returnCmdList[i].replace("RO", "机器人输出信号");
                returnCmdList[i].replace("RI", "机器人输入信号");
                returnCmdList[i].replace("SO", "操作面板输出信号");
                returnCmdList[i].replace("SI", "操作面板输入信号");
                returnCmdList[i].replace("UO", "外围设备输出信号");
                returnCmdList[i].replace("UI", "外围设备输入信号");

    //            returnCmdList[i].replace("TIMER[", "计时器[");
                returnCmdList[i].replace("TIME寄存器", "计时器");
                returnCmdList[i].replace("TIMER_OVERFLOW", "计时器溢出旗标");
                returnCmdList[i].replace("JPOS", "当前位置关节坐标");
                returnCmdList[i].replace("LPOS", "当前位置直角坐标");
                returnCmdList[i].replace("UFRAME", "用户坐标系");
                returnCmdList[i].replace("UTOOL", "工具坐标系");

                returnCmdList[i].replace("MOD", "求余");
                returnCmdList[i].replace("DIV", "整除");
            }
            /******************* SELECT-条件选择 ELSE-其他 *************/
            else if(("SELECT" == rx.cap(1)) || ("ELSE" == rx.cap(1)))
            {
                returnCmdList[i].replace("SELECT", "条件选择");
                returnCmdList[i].replace("ELSE", "其它值");
                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("JMP LBL", "跳转到 标签");
                returnCmdList[i].replace("CALL", "调用程序");
            }
            /******************* SKIP-跳转 *****************************/
            else if("SKIP" == rx.cap(1))
            {
                returnCmdList[i].replace("SKIP", "跳过条件");
                returnCmdList[i].replace("Skip", "跳过");
                returnCmdList[i].replace("LBL", "标签");

                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("PULSE", "脉冲");

                returnCmdList[i].replace("AO", "模拟输出信号");
                returnCmdList[i].replace("AI", "模拟输入信号");
                returnCmdList[i].replace("GO", "群组输出信号");
                returnCmdList[i].replace("GI", "群组输入信号");
                returnCmdList[i].replace("DO", "数字输出信号");
                returnCmdList[i].replace("DI", "数字输入信号");
                returnCmdList[i].replace("RO", "机器人输出信号");
                returnCmdList[i].replace("RI", "机器人输入信号");
                returnCmdList[i].replace("SO", "操作面板输出信号");
                returnCmdList[i].replace("SI", "操作面板输入信号");
                returnCmdList[i].replace("UO", "外围设备输出信号");
                returnCmdList[i].replace("UI", "外围设备输入信号");

                returnCmdList[i].replace(QRegExp("ON[^+]"), "开");
                returnCmdList[i].replace(QRegExp("OFF[^-]"), "关");
                returnCmdList[i].replace("ON+", "信号上升沿");
                returnCmdList[i].replace("OFF-", "信号下降沿");

                returnCmdList[i].replace("AND", "且");
                returnCmdList[i].replace("OR", "或");
            }
            /******************* DO-数字输出信号　AO-模拟输出信号 *****************/
            else if("DO" == rx.cap(1) || "AO" == rx.cap(1))
            {
                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("PULSE", "脉冲");

                returnCmdList[i].replace("AO", "模拟输出信号");
                returnCmdList[i].replace("AI", "模拟输入信号");
                returnCmdList[i].replace("GO", "群组输出信号");
                returnCmdList[i].replace("GI", "群组输入信号");
                returnCmdList[i].replace("DO", "数字输出信号");
                returnCmdList[i].replace("DI", "数字输入信号");
                returnCmdList[i].replace("RO", "机器人输出信号");
                returnCmdList[i].replace("RI", "机器人输入信号");
                returnCmdList[i].replace("SO", "操作面板输出信号");
                returnCmdList[i].replace("SI", "操作面板输入信号");
                returnCmdList[i].replace("UO", "外围设备输出信号");
                returnCmdList[i].replace("UI", "外围设备输入信号");

                returnCmdList[i].replace("ON", "开");
                returnCmdList[i].replace("OFF", "关");
            }
            /******************* DJ-取料　*********************************/
            else if(("DJ" == rx.cap(1)) || ("DWJ" == rx.cap(1)) || ("DTJ" == rx.cap(1)) || ("DDJ" == rx.cap(1)) ||
                    ("FJ" == rx.cap(1)) || ("FWJ" == rx.cap(1)) || ("FTJ" == rx.cap(1)) || ("FDJ" == rx.cap(1)))
            {
                returnCmdList[i].replace("DDJ ", "取料完成 ");
                returnCmdList[i].replace("FDJ ", "放料完成 ");

                returnCmdList[i].replace("DJ ", "取料 ");
                returnCmdList[i].replace("DWJ ", "取料等待 ");
                returnCmdList[i].replace("DTJ ", "取料上方 ");

                returnCmdList[i].replace("FJ ", "放料 ");
                returnCmdList[i].replace("FWJ ", "放料等待 ");
                returnCmdList[i].replace("FTJ ", "放料上方 ");


                returnCmdList[i].replace(QRegExp("[P]\\s*[[]"), "位置[");
                returnCmdList[i].replace(QRegExp("PR"), "位置暂存器");
                returnCmdList[i].replace(QRegExp("[R][[]"), "寄存器[");

                returnCmdList[i].replace("FINE", "通过");
                returnCmdList[i].replace("CNT", "接近");

                returnCmdList[i].replace("DI", "监视输入");
                returnCmdList[i].replace("ON", "开");
                returnCmdList[i].replace("OFF", "关");

                returnCmdList[i].replace("Skip", "跳到");
                returnCmdList[i].replace("LBL", "标签");

                returnCmdList[i].replace("Wjnt", "手腕关节动作");
                returnCmdList[i].replace("INC", "增量运动");
                returnCmdList[i].replace("ACC", "加速度");
                returnCmdList[i].replace("EV", "附加轴速度");
                returnCmdList[i].replace("PTH", "路径");
                returnCmdList[i].replace(QRegExp("[^_]Offset"), " 位置补偿");
                returnCmdList[i].replace("Tool_Offset", "工具补偿");
            }
            /******************* UTOOL-工具坐标系 ************************/
            else if(("UTOOL" == rx.cap(1)) || ("UFRAME" == rx.cap(1)) || ("UTOOL_NUM" == rx.cap(1)) || ("UFRAME_NUM" == rx.cap(1)))
            {
                returnCmdList[i].replace("UTOOL[", "工具坐标系[");
                returnCmdList[i].replace("UFRAME[", "用户坐标系[");
                returnCmdList[i].replace("UTOOL_NUM", "工具坐标系号码");
                returnCmdList[i].replace("UFRAME_NUM", "用户坐标系号码");
                returnCmdList[i].replace("R[", "寄存器[");
                returnCmdList[i].replace("P寄存器", "位置寄存器");
            }
            /******************* RSR-请求启动信号 ************************/
            else if(("RSR" == rx.cap(1)) || ("UALM" == rx.cap(1)) || ("TIMER" == rx.cap(1)) || ("OVERRIDE" == rx.cap(1))
                    || ("MESSAGE" == rx.cap(1)) || ("JOINT_MAX_SPEED" == rx.cap(1)) || ("LINEAR_MAX_SPEED" == rx.cap(1)))
            {
                returnCmdList[i].replace("RSR", "启动请求信号");
                returnCmdList[i].replace("UALM", "用户报警");
                returnCmdList[i].replace("TIMER", "计时器");
                returnCmdList[i].replace("OVERRIDE", "速度倍率");
                returnCmdList[i].replace("MESSAGE", "消息");
                returnCmdList[i].replace("JOINT_MAX_SPEED", "关节最大速度");
                returnCmdList[i].replace("LINEAR_MAX_SPEED", "直线最大速度");

                returnCmdList[i].replace("ENABLE", "有效");
                returnCmdList[i].replace("DISABLE", "无效");

                returnCmdList[i].replace("START", "启动");
                returnCmdList[i].replace("STOP", "停止");
                returnCmdList[i].replace("RESET", "复位");

                returnCmdList[i].replace("R[", "寄存器[");
            }
            /**************** MOVE_FREE *****************/
            else if(rx.cap(1) == "MOVE_FREE")
            {
                returnCmdList[i].replace("MOVE_FREE", "自由导航");
                returnCmdList[i].replace("JMP",       "跳转");
                returnCmdList[i].replace("DP[",       "单点[");
                returnCmdList[i].replace("DPR[",      "自动绕障[");
                returnCmdList[i].replace("DPL[",      "轨道最短[");
                returnCmdList[i].replace("IMU",       "惯性导航");
                returnCmdList[i].replace("WHEEL",     "导轮导航");
                returnCmdList[i].replace("LASER",     "激光导航");
                returnCmdList[i].replace("FINE",      "精准到点");
                returnCmdList[i].replace("CNT",       "平滑系数");
                returnCmdList[i].replace("SPLINE",      "样条轨迹");
                returnCmdList[i].replace("LINE",      "直线轨迹");
                returnCmdList[i].replace("ROTATE",      "旋转");
                returnCmdList[i].replace("AUTO",      "自由轨迹");
                returnCmdList[i].replace("QR[",    "二维码[");
                returnCmdList[i].replace("OP",    "普通定位");
                returnCmdList[i].replace("VMark[",    "V槽[");
                returnCmdList[i].replace("Laser[",    "激光类型[");
                returnCmdList[i].replace("NODET",     "不探测障碍");
                returnCmdList[i].replace("DET",       "探测障碍");
                returnCmdList[i].replace("OMNI",     "全向轮");
                returnCmdList[i].replace("LB[",       "标签[");
                returnCmdList[i].replace("CU1",         "反光定位");
                returnCmdList[i].replace("P",         "正向");
                returnCmdList[i].replace("N",         "反向");
            }
            /**************** MOVE_MAG *****************/
            else if(rx.cap(1) == "MOVE_MAG")
            {
                returnCmdList[i].replace("MOVE_MAG", "磁导航");
                returnCmdList[i].replace("FRONT",    "正向运行");
                returnCmdList[i].replace("BACK",     "反向运行");
                returnCmdList[i].replace("RFID_STOP","射频标签停止");
                returnCmdList[i].replace("RFID","射频标签");
                returnCmdList[i].replace("INPUT",    "开关量停止");
                returnCmdList[i].replace("MAG_STOP", "磁条宽度停止");
                returnCmdList[i].replace("L",        "往左运行");
                returnCmdList[i].replace("M",        "往中间运行");
                returnCmdList[i].replace("R",        "往右运行");

            }
            /*************** MODBUS_START **************/
            else if(rx.cap(1) == "MODBUS_START")
            {
                returnCmdList[i].replace("MODBUS_START", "Modbus创建");
                returnCmdList[i].replace("INTERNET",     "以太网");
                returnCmdList[i].replace("RS485",        "Rs485");
                returnCmdList[i].replace("MASTER",       "主机模式");
                returnCmdList[i].replace("SLAVE",        "从机模式");
                returnCmdList[i].replace("JMP LB[",      "跳转标签[");
            }
            /*************** MODBUS_READ **************/
            else if(rx.cap(1) == "MODBUS_READ")
            {
                returnCmdList[i].replace("MODBUS_READ",  "Modbus读");
                returnCmdList[i].replace("R[",           "寄存器[");
                returnCmdList[i].replace("INTERNET",     "以太网");
                returnCmdList[i].replace("RS485",        "Rs485");
                returnCmdList[i].replace("MASTER",       "主机模式");
                returnCmdList[i].replace("SLAVE",        "从机模式");
                returnCmdList[i].replace("JMP LB[",      "跳转标签[");
            }
            /*************** MODBUS_WRITE **************/
            else if(rx.cap(1) == "MODBUS_WRITE")
            {
                returnCmdList[i].replace("MODBUS_WRITE",  "Modbus写");
                returnCmdList[i].replace("R[",            "寄存器[");
                returnCmdList[i].replace("INTERNET",      "以太网");
                returnCmdList[i].replace("RS485",         "Rs485");
                returnCmdList[i].replace("MASTER",        "主机模式");
                returnCmdList[i].replace("SLAVE",         "从机模式");
                returnCmdList[i].replace("JMP LB[",       "跳转标签[");
            }
            /*************** TCP_START **************/
            else if(rx.cap(1) == "TCP_START")
            {
                returnCmdList[i].replace("TCP_START",   "以太网创建");
                returnCmdList[i].replace("SERVER",      "服务器");
                returnCmdList[i].replace("CLIENT",      "客户端");
                returnCmdList[i].replace("JMP LB[",     "跳转标签[");
            }
            /*************** TCP_READ **************/
            else if(rx.cap(1) == "TCP_READ")
            {
                returnCmdList[i].replace("TCP_START",   "以太网接收");
                returnCmdList[i].replace("R[",          "寄存器[");
                returnCmdList[i].replace("SERVER",      "服务器");
                returnCmdList[i].replace("CLIENT",      "客户端");
                returnCmdList[i].replace("JMP LB[",     "跳转标签[");

            }
            /*************** TCP_WRITE **************/
            else if(rx.cap(1) == "TCP_WRITE")
            {
                returnCmdList[i].replace("TCP_WRITE",   "以太网发送");
                returnCmdList[i].replace("R[",          "寄存器[");
                returnCmdList[i].replace("SERVER",      "服务器");
                returnCmdList[i].replace("CLIENT",      "客户端");
                returnCmdList[i].replace("JMP LB[",     "跳转标签[");
            }
            /************** CHARGING ****************/
            else if(rx.cap(1) == "CHARGING")
            {
                returnCmdList[i].replace("CHARGING",    "充电");
                returnCmdList[i].replace("TIME",        "充电时间");
                returnCmdList[i].replace("CAPARITY",    "充电容量");
                returnCmdList[i].replace("FIRFIN",      "最先完成项");
            }
            /************** CHECK BATTERY ***********/
            else if(rx.cap(1) == "CHECK_BATTERY")
            {
                returnCmdList[i].replace("CHECK_BATTERY", "电量检查");
                returnCmdList[i].replace("LBL[",          "异常跳转标签[");
            }
            /************** LIFT ********************/
            else if(rx.cap(1) == "LIFT")
            {
                returnCmdList[i].replace("LIFT",     "升降机构");
                returnCmdList[i].replace("General",  "通用");
                returnCmdList[i].replace("Heavy",  "重载");
                returnCmdList[i].replace("RISE",     "上升到顶部");
                returnCmdList[i].replace("DOWN",     "下降到底部");
                returnCmdList[i].replace("RIMI",     "上升到中间");
                returnCmdList[i].replace("DOMI",     "下降到中间");
                returnCmdList[i].replace("JMP LB[",  "跳转标签[");

            }
            /************* LOAD_MAP ****************/
            else if(rx.cap(1) == "LOAD_MAP")
            {
                returnCmdList[i].replace("LOAD_MAP",  "加载地图");
                returnCmdList[i].replace("JMP LB[",   "跳转标签[");
            }
            /************* MUSIC ******************/
            else if(rx.cap(1) == "MUSIC")
            {
                returnCmdList[i].replace("MUSIC",  "音乐");
                returnCmdList[i].replace("PAUSE",  "暂停");
                returnCmdList[i].replace("CYCLE",  "循环");
            }
            /************* SET_ODOM ******************/
            else if(rx.cap(1) == "SET_ODOM")
            {
                returnCmdList[i].replace("SET_ODOM",  "里程计重置");
            }
            /************* ROBOT_MOVE ****************/
            else if(rx.cap(1) == "ROBOT_MOVE")
            {
                // 指令格式: ROBOT_MOVE IP[127.0.0.1],PORT[5050],SERVER,SEND[sendParameter],WAIT[waitParameter],TIMEOUT 1,JMP LBL[1]  //
                if(returnCmdList[i].contains("SERVER"))
                {
                    returnCmdList[i].replace("SERVER",   "服务器");
                    returnCmdList[i].replace("IP[",      "本地IP[");
                }
                else if(returnCmdList[i].contains("CLIENT"))
                {
                    returnCmdList[i].replace("CLIENT",   "客户端");
                    returnCmdList[i].replace("IP[",      "服务器IP[");
                }
                returnCmdList[i].replace("PORT[",        "端口");
                returnCmdList[i].replace("ROBOT_MOVE",   "机械手控制");
                returnCmdList[i].replace("SEND[",        "发送参数[");
                returnCmdList[i].replace("WAIT[",        "等待参数[");
                returnCmdList[i].replace("TIMEOUT",      "超时时间");
                returnCmdList[i].replace("JMP LBL[",     "跳转标签[");
            }
            /************* ROLLER ******************/
            else if(rx.cap(1) == "ROLLER")
            {
                returnCmdList[i].replace("ROLLER",  "滚筒机构");
                returnCmdList[i].replace("JMP LB[",     "跳转标签[");
                returnCmdList[i].replace("General",     "普通类型");
                returnCmdList[i].replace("Heavy",     "重型");
                returnCmdList[i].replace("P",     "左侧载货");
                returnCmdList[i].replace("R",     "左侧卸货");
                returnCmdList[i].replace("A",     "右侧载货");
                returnCmdList[i].replace("B",     "右侧卸货");
            }
            else if(rx.cap(1) == "RUNVISION")
            {
                returnCmdList[i].replace("RUNVISION",  "运行视觉工艺");
            }
            else if(rx.cap(1) == "TRIGGERVISION")
            {
                returnCmdList[i].replace("TRIGGERVISION",  "触发视觉");
            }
            else if(rx.cap(1) == "GETVISIONDATA")
            {
                returnCmdList[i].replace("GETVISIONDATA",  "获取视觉数据");
            }
            else if(rx.cap(1) == "CLEARVISIONDATA")
            {
                returnCmdList[i].replace("CLEARVISIONDATA",  "清除视觉数据");
            }
            else if(rx.cap(1) == "TRACKSTART")
            {
                returnCmdList[i].replace("TRACKSTART",  "跟踪开始");
            }
            else if(rx.cap(1) == "TRACKEND")
            {
                returnCmdList[i].replace("TRACKEND",  "跟踪结束");
            }
            else if(rx.cap(1) == "GETTRACKDATA")
            {
                returnCmdList[i].replace("GETTRACKDATA",  "获取跟踪数据");
            }
            else if(rx.cap(1) == "AXISMOVE")
            {
                returnCmdList[i].replace("AXISMOVE",  "轴运动");
                returnCmdList[i].replace("AXIS[",  "轴[");
                returnCmdList[i].replace("TARGET",  "目标值");
                returnCmdList[i].replace("ABSOLUTE",  "绝对位置");
                returnCmdList[i].replace("CARREFERENCE",  "相对车");
                returnCmdList[i].replace("MAPREFERENCE",  "相对地图");
                returnCmdList[i].replace("INC",  "增量运动");
                returnCmdList[i].replace("FOLLOW",  "相对主动轴");
            }
            else if(rx.cap(1) == "LASERCAMERA_CTRL")
            {
                returnCmdList[i].replace("LASERCAMERA_CTRL",  "激光相机控制");
                returnCmdList[i].replace("ON",  "开启");
                returnCmdList[i].replace("OFF",  "关闭");
            }
            else if(rx.cap(1) == "RECORD_LASERCAMERA")
            {
                returnCmdList[i].replace("RECORD_LASERCAMERA",  "激光相机取点");
                returnCmdList[i].replace("PR[", "位置寄存器[");

            }
            else if(rx.cap(1) == "LASERCAMERA_TRACK")
            {
                returnCmdList[i].replace("LASERCAMERA_TRACK",  "激光相机跟踪");
                returnCmdList[i].replace("ON",  "开启");
                returnCmdList[i].replace("OFF",  "关闭");
            }
            else if(rx.cap(1) == "BUFFERMOVE")
            {
                returnCmdList[i].replace("BUFFERMOVE",  "缓存轨迹运动");
                returnCmdList[i].replace("CONST",  "定姿态");
                returnCmdList[i].replace("ORI",  "变姿态");

            }
            else if(rx.cap(1) == "LASERSCAN")
            {
                returnCmdList[i].replace("LASERSCAN",  "激光扫描");
                returnCmdList[i].replace("START",  "开始");
                returnCmdList[i].replace("END",  "结束");

            }
            else if(rx.cap(1) == "W")
            {
                //Weave
                returnCmdList[i].replace("Weave",  "摆焊");
                returnCmdList[i].replace("End",  "终止");
                //Weld
                returnCmdList[i].replace("Weld",  "焊接");
                returnCmdList[i].replace("Start",  "开始");
            }
            //其他
            else
            {
                returnCmdList[i].replace("Tool_Offset", "工具补偿");
                returnCmdList[i].replace("Offset", "位置补偿");
                returnCmdList[i].replace("PR[", "位置寄存器[");
                returnCmdList[i].replace("R[", "寄存器[");
            }
        }
    }
    // Chinese -> English
    else if(language == ENUM_LAN_ENGLISH)
    {

    }
    else
    {

    }

    return returnCmdList;
}

ProgramLanguageTranslate::~ProgramLanguageTranslate()
{

}
